<template>
	<view class="out">
		<view class="header" v-if="!userInfo">
			<image @click="tologin" class="profile" src="//edu-image.nosdn.127.net/7c5a8d29-ce20-4f97-a3a6-49872772667d.png" mode=""></image>
			<view @click="tologin" class="username">登录 / 注册</view>
		</view>
		<view class="header" v-else >
			<image  class="profile" :src="userInfo.avatarUrl" mode=""></image>
			<view  class="username">{{userInfo.nickName}} </view>
		</view>
		<view class="list">
			<view class="left  iconfont icon-dingdankong "></view>
			<view class="center">我的订单</view>
			<view class="right  iconfont icon-jiantou1"></view>
		</view>
		<view class="list">
			<view class="left  iconfont .icon-youhuiquan "></view>
			<view class="center">我的优惠卷</view>
			<view class="right  iconfont icon-jiantou1"></view>
		</view>
		<view class="list">
			<view class="left  iconfont icon-gouwuchefill "></view>
			<view class="center" @click="toshopcar">我的购物车</view>
			<view class="right  iconfont icon-jiantou1"></view>
		</view>
		<view class="list">
			<view class="left  iconfont icon-qiapian "></view>
			<view class="center">我的学习卡</view>
			<view class="right  iconfont icon-jiantou1"></view>
		</view>
		<view class="listlast">
			<view class="left  iconfont icon-qiapian "></view>
			<view class="center">我的学习卡</view>
			<view class="right  iconfont icon-jiantou1"></view>
		</view>
	</view>
</template>

<script>
export default {
	mounted(){
		this.userInfo = wx.getStorageSync("userInfo_key")
	},
	data() {
		return {
			userInfo:{}
		};
	},
	methods: {
		tologin(){
			wx.navigateTo({
				url:"../login/login"
			})
		},
		toshopcar(){
			wx.switchTab({
				url:"../shopcar/shopcar"
			})
		}
	}
};
</script>

<style lang="stylus">
.out
	height 100%
	background-color #f4f4f4
	.header
		padding 30rpx
		display flex
		align-items center
		background-color #FFFFFF
		.profile
			width 100rpx
			height 100rpx
		.username
			padding 0 40rpx
	.list
		background-color #FFFFFF
		display flex
		justify-content center
		.left
			height 100rpx
			width 80rpx
			line-height 100rpx
			text-align center
			font-size 40rpx
			font-weight 600
			color #ccc
		.center
			flex 1
			height 100rpx
			line-height 100rpx
			border-bottom 2rpx solid #f4f4f4
		.right
			height 100rpx
			width 50rpx
			line-height 100rpx
			text-align center
			font-size 40rpx
			font-weight 600
			color #ccc
			border-bottom 2rpx solid #f4f4f4
	.listlast
		background-color #FFFFFF
		display flex
		justify-content center
		margin-top 40rpx
		.left
			height 100rpx
			width 80rpx
			line-height 100rpx
			text-align center
			font-size 40rpx
			font-weight 600
			color #ccc
		.center
			flex 1
			height 100rpx
			line-height 100rpx
			border-bottom 2rpx solid#f4f4f4
		.right
			height 100rpx
			width 50rpx
			line-height 100rpx
			text-align center
			font-size 40rpx
			font-weight 600
			color #ccc
			border-bottom 2rpx solid #f4f4f4
</style>
